index.html.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation></HomePageNavigation>
  6. <!-- 面包屑导航 -->
  7. <div class="breadcrumb">
  8. <div class="inner">
  9. <span class="location">您的位置:</span>
  10. <el-breadcrumb :separator-icon="ArrowRight">
  11. <el-breadcrumb-item>
  12. <NuxtLink to="/">首页</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item>
  15. {{ newsDetail.con_title }}
  16. </el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. </div>
  20. <!-- 资讯列表 -->
  21. <div class="newsDetail">
  22. <div class="inner">
  23. <div class="innerLeft">
  24. <div class="leftBottomImg" v-if="newsDetail.con_title == '会员服务'">
  25. <img src="../../../public/index/hyfw.jpg" alt="">
  26. </div>
  27. <div class="leftBottomImg" v-if="newsDetail.con_title == '联系我们'">
  28. <img src="../../../public/index/lxwm.jpg" alt="">
  29. </div>
  30. <div class="leftBottomImg" v-if="newsDetail.con_title == '法制项目简介'">
  31. <img src="../../../public/index/xmwzjj.png" alt="">
  32. </div>
  33. <div class="leftBottomImg" v-if="newsDetail.con_title == '免责声明'">
  34. <img src="../../../public/index/mzsm.png" alt="">
  35. </div>
  36. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  37. </div>
  38. <div class="innerRight">
  39. <ul>
  40. <li v-for="(item, index) in bottomMenu" :key="index">
  41. <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
  42. :class="item.id == pageId ? 'active' : ''">
  43. {{ item.name }}
  44. </NuxtLink>
  45. <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
  46. :title="item.name" :class="item.id == pageId ? 'active' : ''">
  47. {{ item.name }}
  48. </NuxtLink>
  49. </li>
  50. </ul>
  51. </div>
  52. <div style="clear: both;"></div>
  53. </div>
  54. </div>
  55. <!-- 页面底部 -->
  56. <HomeFoot></HomeFoot>
  57. </template>
  58. <script setup>
  59. //1.页面依赖 start ---------------------------------------->
  60. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  61. import { ArrowRight } from '@element-plus/icons-vue'
  62. import { ref, onMounted } from 'vue';
  63. //获得跳转过来的id
  64. const route = useRoute();
  65. //获得当前的完整路径
  66. const fullPath = route.path;
  67. //拆分,取出来中间这一段,然后提取数字部分
  68. const segments = fullPath.split('/');
  69. const targetSegment = segments[2];
  70. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  71. let articleId;
  72. let pageId;
  73. //通过导航路径反向查询导航id
  74. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  75. method: 'GET',
  76. query: {
  77. 'foot_pinyin': targetSegment,
  78. },
  79. });
  80. if (getRouteId.code == 200) {
  81. articleId = getRouteId.data.id;
  82. pageId = getRouteId.data.id;
  83. } else {
  84. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  85. // console.log("错误位置:通过url路径查询导航池id")
  86. // console.log("后端错误反馈:",getRouteId.message)
  87. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  88. }
  89. //1.页面依赖 end ---------------------------------------->
  90. //2.页面数据 start ---------------------------------------->
  91. //广告列表
  92. const adList = ref([]);
  93. let adImg1 = ref([]);
  94. let adImg2 = ref([]);
  95. async function getAdData() {
  96. const adData = await requestDataPromise('/web/getWebsiteAdvertisement', { method: 'GET', query: { 'ad_tag': 'PAGE' } });
  97. adList.value = adData.data;
  98. if (adData.code == 200) {
  99. for (let item of adData.data) {
  100. if (item.ad_tag == 'PAGE_0001') {
  101. adImg1.value = item;
  102. }
  103. if (item.ad_tag == 'PAGE_0002') {
  104. adImg2.value = item;
  105. }
  106. }
  107. } else {
  108. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  109. console.log("错误位置:获取详情页广告列表")
  110. console.log("后端错误反馈:", adData.message)
  111. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  112. }
  113. }
  114. getAdData();
  115. const newsDetail = ref({})
  116. const bottomMenu = ref([]);
  117. async function getPageData() {
  118. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  119. method: 'GET',
  120. query: {
  121. 'fcat_id': articleId
  122. },
  123. });
  124. newsDetail.value = mkdata.data;
  125. }
  126. getPageData();
  127. async function getPageMenu() {
  128. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  129. method: 'GET',
  130. query: {},
  131. });
  132. bottomMenu.value = mkdata.data;
  133. }
  134. getPageMenu();
  135. //2.页面数据 end ---------------------------------------->
  136. //4.设置seo信息 start---------------------------------------->
  137. //4.1 设置seo信息
  138. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  139. method: 'GET',
  140. query: {},
  141. });
  142. let seoTitle = setData.data.website_head.title;
  143. let seoDescription = setData.data.website_head.description;
  144. let seoKeywords = setData.data.website_head.keywords;
  145. let seoSuffix = setData.data.website_head.suffix;
  146. let seoName = setData.data.website_head.website_name;
  147. useSeoMeta({
  148. title: seoTitle + "_" + seoSuffix,
  149. meta: [
  150. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  151. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  152. ]
  153. });
  154. //4.设置seo信息 end---------------------------------------->
  155. onMounted(async () => {
  156. //从客户端获取行政职能部门 加快打开速度
  157. const { $webUrl, $CwebUrl } = useNuxtApp();
  158. //广告1
  159. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
  160. const responseAd1 = await fetch(url, {
  161. headers: {
  162. 'Content-Type': 'application/json',
  163. 'Userurl': $CwebUrl,
  164. 'Origin': $CwebUrl
  165. }
  166. });
  167. const resultAd1 = await responseAd1.json();
  168. adImg1.value = resultAd1.data[0];
  169. //广告2
  170. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
  171. const responseAd2 = await fetch(url2, {
  172. headers: {
  173. 'Content-Type': 'application/json',
  174. 'Userurl': $CwebUrl,
  175. 'Origin': $CwebUrl
  176. }
  177. });
  178. const resultAd2 = await responseAd2.json();
  179. adImg2.value = resultAd2.data[0];
  180. })
  181. </script>
  182. <style lang="less" scoped>
  183. //导航条
  184. .breadcrumb {
  185. width: 100%;
  186. .inner {
  187. width: 1200px;
  188. margin: 10px auto;
  189. border-bottom: 1px solid #E5E5E5;
  190. }
  191. .el-breadcrumb::v-deep {
  192. display: inline-block;
  193. vertical-align: -4px;
  194. }
  195. .el-breadcrumb__inner a::v-deep,
  196. .el-breadcrumb__inner.is-link::v-deep {
  197. color: #666666;
  198. font-weight: 400;
  199. text-decoration: none;
  200. transition: var(--el-transition-color);
  201. }
  202. span {
  203. font-family: "宋体";
  204. font-weight: 400;
  205. font-size: 14px;
  206. color: #666666;
  207. line-height: 40px;
  208. text-align: left;
  209. font-style: normal;
  210. text-transform: none;
  211. }
  212. .location {
  213. margin-right: 10px;
  214. display: inline-block;
  215. height: 40px;
  216. line-height: 40px;
  217. font-family: "宋体";
  218. font-weight: 400;
  219. font-size: 14px;
  220. color: #666666;
  221. vertical-align: 11px;
  222. }
  223. }
  224. // 资讯列表
  225. .newsDetail {
  226. width: 100%;
  227. margin-bottom: 70px;
  228. .inner {
  229. width: 1200px;
  230. font-size: 16px;
  231. .innerLeft {
  232. width: 980px;
  233. float: right;
  234. .LeftTop {
  235. margin-top: 50px;
  236. >h1 {
  237. line-height: 40px;
  238. margin-bottom: 30px;
  239. font-family: Microsoft YaHei, Microsoft YaHei;
  240. font-weight: bold;
  241. font-size: 30px;
  242. color: #333333;
  243. }
  244. >p {
  245. height: 18px;
  246. line-height: 18px;
  247. font-family: Microsoft YaHei, Microsoft YaHei;
  248. font-weight: 400;
  249. font-size: 14px;
  250. color: #999999;
  251. span {
  252. margin-right: 40px;
  253. }
  254. }
  255. >img {
  256. width: 680px;
  257. height: 382px;
  258. padding: 50px 0px 60px 55px;
  259. }
  260. }
  261. .leftBottomImg {
  262. width: 760px;
  263. height: 184px;
  264. margin: 0 auto;
  265. }
  266. .leftBottom {
  267. width: 92%;
  268. font-size: 20px;
  269. padding-top: 40px;
  270. margin: 0 auto;
  271. font-family: "微软雅黑", Microsoft YaHei;
  272. line-height: 36px;
  273. >h3,
  274. >p {
  275. text-indent: 2em;
  276. width: 790px;
  277. font-family: "微软雅黑", Microsoft YaHei;
  278. font-size: 20px;
  279. color: #333333;
  280. line-height: 23px;
  281. padding-bottom: 30px;
  282. }
  283. >h3 {
  284. font-weight: 600px;
  285. }
  286. >p {
  287. font-weight: 400;
  288. }
  289. }
  290. }
  291. .innerRight {
  292. width: 200px;
  293. margin-top: 20px;
  294. font-family: "微软雅黑";
  295. ul {
  296. li {
  297. a {
  298. display: block;
  299. height: 50px;
  300. line-height: 50px;
  301. color: #000;
  302. background: #f3f3f3;
  303. font-size: 18px;
  304. text-decoration: none;
  305. padding-left: 35px;
  306. box-sizing: border-box;
  307. border-bottom: 1px solid #fff;
  308. }
  309. }
  310. }
  311. .active {
  312. border-left: 0;
  313. background: #3395e4;
  314. color: #fff;
  315. }
  316. }
  317. }
  318. }
  319. </style>
  320. <style lang="less" scoped>
  321. @media screen and (min-width:801px) {
  322. .pc_none {
  323. display: none;
  324. }
  325. }
  326. @media screen and (max-width:800px) {
  327. /*ipad_phone*/
  328. .breadcrumb {
  329. margin-bottom: 11px;
  330. }
  331. .breadcrumb .location {
  332. font-size: 14px;
  333. }
  334. .breadcrumb span {
  335. font-size: 14px;
  336. }
  337. .breadcrumb /deep/.el-breadcrumb {
  338. vertical-align: middle;
  339. }
  340. .newsDetail {
  341. margin: 10px auto 0px;
  342. }
  343. .newsDetail .inner {
  344. width: 92%;
  345. margin: 0px auto 11px;
  346. overflow: hidden;
  347. }
  348. .newsDetail .inner .innerRight {
  349. width: 24%;
  350. display: none;
  351. }
  352. .newsDetail .inner .innerRight .rightMenuTitle {
  353. width: 100%;
  354. height: auto;
  355. background-size: 100% 155%;
  356. margin-bottom: 11px;
  357. display: block;
  358. width: 100%;
  359. height: auto;
  360. line-height: 33px;
  361. font-size: 14px;
  362. text-align: center;
  363. }
  364. .newsDetail .inner .innerRight ul {
  365. display: block;
  366. width: 100%;
  367. height: auto;
  368. }
  369. .newsDetail .inner .innerRight ul li {
  370. display: block;
  371. width: 100%;
  372. height: auto;
  373. }
  374. .newsDetail .inner .innerRight ul li a {
  375. line-height: 20px;
  376. height: auto;
  377. font-size: 12px;
  378. margin-bottom: 5px;
  379. padding: 6px 2px;
  380. box-sizing: border-box;
  381. border-left: 2px solid #028E21;
  382. }
  383. .newsDetail .inner .innerLeft {
  384. width: 100%;
  385. float: none;
  386. overflow: hidden;
  387. margin: 0;
  388. }
  389. .newsDetail .inner .innerLeft .book_son_right {
  390. float: none;
  391. width: 100%;
  392. overflow: hidden;
  393. margin-bottom: 22px;
  394. }
  395. .newsDetail .inner .innerLeft .leftBottomTitle {
  396. height: 50px;
  397. line-height: 50px;
  398. font-size: 18px;
  399. }
  400. .newsDetail .inner .innerLeft .leftBottom {
  401. width: 100%;
  402. padding-top: 11px;
  403. line-height: 22px;
  404. font-size: 16px !important;
  405. }
  406. .newsDetail .inner .innerLeft .leftBottom * {
  407. line-height: 22px;
  408. font-size: 16px !important;
  409. }
  410. .leftBottom /deep/.daohang ul {
  411. overflow: hidden;
  412. }
  413. .leftBottom /deep/.daohang li {
  414. float: left;
  415. margin: 1%;
  416. box-sizing: border-box;
  417. border: solid 1px #ddd;
  418. padding: 1vw;
  419. width: 23%;
  420. text-align: center;
  421. }
  422. .leftBottom /deep/.daohang li a {
  423. font-size: 14px !important;
  424. color: #333;
  425. }
  426. .phone_none {
  427. display: none;
  428. }
  429. }
  430. </style>